﻿<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="/vendor/html5.js"></script>
<script type="text/javascript" src="/vendor/respond.min.js"></script>
<script type="text/javascript" src="/vendor/PIE_IE678.js"></script>
<![endif]-->
<link href="/static/admin/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="/static/admin/css/H-ui.login.css" rel="stylesheet" type="text/css" />
<link href="/static/admin/css/style.css" rel="stylesheet" type="text/css" />
<link href="/vendor/Hui-iconfont/1.0.7/iconfont.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="/vendor/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title><{$app_site_name}></title>
<meta name="keywords" content="<{$app_keywords}>">
<meta name="description" content="<{$app_description}>">
<style>
.header, .footer {
    display:none;
}
.loginWraper{background: #3283AC url(/static/admin/images/login-bg<{$app_loginback}>.jpg) no-repeat center;}
</style>

</head>
<body>
<div class="header"></div>
<div class="loginWraper">
  <div id="loginform" class="loginBox">
    <form autocomplete="off" class="jq_validate form form-horizontal" action="<{:url('publics/login')}>" method="post">
      <div class="row cl">
        <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60d;</i></label>
        <div class="formControls col-xs-8">
          <input type="text" class="input-text size-L"
          placeholder="账户"
          name="username" 
          data-rule-required="true"
          data-msg-required="请输入用户名"
          />
        </div>
      </div>
      <div class="row cl">
        <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60e;</i></label>
        <div class="formControls col-xs-8">
          <input type="password" class="input-text size-L"
          placeholder="密码"
          name="password" 
          data-rule-required="true"
          data-msg-required="请输入密码"
          />
        </div>
      </div>
      <div class="row cl">
        <div class="formControls col-xs-8 col-xs-offset-3">
          <input class="input-text size-L" type="text" style="width:150px;"
          placeholder="验证码"
          name="code" 
          data-rule-required="true"
          data-msg-required="请输入验证码"
          />
          <img id="img" src="<{:url('publics/verify')}>"  onclick="this.src='<{:url('publics/verify')}>?t='+Math.random()">
        </div>
      </div>
      <!-- 
      <div class="row cl">
        <div class="formControls col-xs-8 col-xs-offset-3">
          <label for="is_remember">
            <input type="checkbox" id="is_remember" name="is_remember" value="yes">下次自动登录
          </label>
        </div>
      </div>
       -->
      <div class="row cl">
        <div class="formControls col-xs-8 col-xs-offset-3">
          <input type="submit" class="btn btn-success radius size-L" value="&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;">
          <input type="reset" class="btn btn-default radius size-L" value="&nbsp;取&nbsp;&nbsp;&nbsp;&nbsp;消&nbsp;">
        </div>
      </div>
    </form>
  </div>
</div>
<div class="footer"><{$app_right}></div>
<script type="text/javascript" src="/vendor/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="/static/admin/js/H-ui.js"></script>

<!-- 验证插件 start -->
<script type="text/javascript" src="/vendor/jquery.validation/1.14.0/jquery.validate.min.js"></script>
<script type="text/javascript" src="/vendor/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="/vendor/jquery.validation/1.14.0/messages_zh.min.js"></script>
<!-- 验证插件 end -->

<!-- loading插件 start -->
<script type="text/javascript" src="/vendor/jquery.ShowLoading/1.0/jquery.ShowLoading.js"></script>
<link href="/vendor/jquery.ShowLoading/1.0/jquery.ShowLoading.css" rel="stylesheet">
<!-- loading插件 end -->

<!-- layui插件 start -->
<script type="text/javascript" src="/vendor/layui/layui.js"></script>
<!-- layui插件 end -->


<style>
label.error {
    right: 75px;
    top: 5px;
    color: #ef392b;
    font-size: 12px;
}
#code-error{left:80px;width:90px;}
.loginBox{top:45%;}
</style>
<script>
$().ready(function(){
	$(".jq_validate").validate({
		submitHandler: function(form) {
			fv = this;
			$(".loginWraper").showLoading();			
			$.ajax({
	            url: form.action,
	            type: 'POST',
	            dataType: "json",
	            data:$(form).serialize(),
	            success: function( rs ) {
	            	//成功
	    			if(rs.r==0){
	    				if(rs.suc.url!=''){
	    					window.location.href = rs.suc.url;	
	    				}
					//错误							    				
	    			}else{
	    				var type = rs.err.js_action;
	    				switch(type){
	    					case 'error':
	    							var json = "{"+rs.name+":'"+rs.msg+"'}";
	    							var f    = eval("("+json+")");
	    							fv.showErrors(f);
    								$("#img").click();
	    							return;
	    					case '':
	    						return false;
							default:
								return;
	    				}
	    			}
	            },
	            error: function(){
	            	layui.use(['layer'], function(){
	            		  var layer = layui.layer;
	            		  layer.msg('网络错误!');
	            	});
	            },
	            
	            complete: function(){
	            	$(".loginWraper").hideLoading();
	            }
			});
		}
	});
});
</script>
</body>
</html>